import {api} from './api.js'
import {ajax} from '../utils/ajax.js'

const login = function(params) {
  return ajax('post', api.login, params)
}

const setRegion = function(params) {
  return ajax('post', api.setRegion, params)
}

const buy = function(params) {
  return ajax('post', api.buy, params)
}

const appliaction = function (params) {
  return ajax('post', api.appliaction, params)
}

const application = function (params) {
  return ajax('get', api.application, params)
}

const income = function (params) {
  return ajax('get', api.income, params)
}

const sum = function (params) {
  return ajax('get', api.sum, params)
}

const sms = function (params) {
  return ajax('post', api.sms, params)
}

const notify = function (params) {
  return ajax('get', api.notify, params)
}

const data = function (params) {
  return ajax('get', api.data, params)
}

const oxt = function (params) {
  return ajax('post', api.oxt, params)
}

const rmb = function (params) {
  return ajax('post', api.rmb, params)
}

const setSwitch = function (params) {
  return ajax('post', api.setSwitch, params)
}

const setAlipay = function (params) {
  return ajax('post', api.setAlipay, params)
}

const setBank = function (params) {
  return ajax('post', api.setBank, params)
}

const setWechat = function (params) {
  return ajax('post', api.setWechat, params)
}

const setServant = function (params) {
  return ajax('post', api.setServant, params)
}

const getQr = function (params) {
  return ajax('get', api.getQr, params)
}

const getQualification = function(params) {
  return ajax('get', api.getQualification, params)
}

const getManual = function (params) {
  return ajax('get', api.getManual, params)
}

const selectRegion = function (params) {
  return ajax('get', api.selectRegion, params)
}

const pay = function (params) {
  return ajax('post', api.pay, params)
}

const getProtocol = function (params) {
  return ajax('get', api.getProtocol, params)
}

const setRealId = function (params) {
  return ajax('post', api.setRealId, params)
}

const getHomeData = function (params) {
  return ajax('get', api.getHomeData, params)
}

const getReDetail = function (params) {
  return ajax('get', api.getReDetail, params)
}

const getMachineStatus = function (params) {
  return ajax('post', api.getMachineStatus, params)
}

module.exports = {
  login,
  setRegion,
  buy,
  appliaction,
  application,
  income,
  sum,
  sms,
  notify,
  data,
  oxt,
  rmb,
  setSwitch,
  setAlipay,
  setBank,
  setWechat,
  setServant,
  getQr,
  getQualification,
  getManual,
  selectRegion,
  pay,
  getProtocol,
  setRealId,
  getHomeData,
  getReDetail,
  getMachineStatus
}